package com.aspose.cells;

class zcew {
   static int a(byte[] var0, int var1) {
      return com.aspose.cells.b.a.zc.e(var0, var1) & '\uffff' & 16383;
   }

   static int b(byte[] var0, int var1) {
      return com.aspose.cells.b.a.zc.a(var0, var1) & 1048575;
   }

   static int a(byte[] var0, int var1, int var2, byte var3) {
      if ((var3 & 255 & 128) == 0) {
         return com.aspose.cells.b.a.zc.a(var0, var1);
      } else {
         int var4 = com.aspose.cells.b.a.zc.a(var0, var1);
         if (var4 + var2 > 1048575) {
            int var5 = var4 + var2 - 1048575 - 1;
            return var5;
         } else {
            return var4 + var2;
         }
      }
   }

   static void a(byte[] var0, int var1, int var2, int var3, boolean var4, boolean var5) {
      if (!var4 && var5) {
         int var6 = var2 - var3;
         byte[] var7 = com.aspose.cells.b.a.zc.a(var6);
         if (var6 < 0) {
            var7[3] = 0;
            var7[2] = (byte)(var7[2] & 15);
         }

         System.arraycopy(var7, 0, var0, var1, 4);
      } else {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2), 0, var0, var1, 4);
      }

   }

   static void b(byte[] var0, int var1, int var2, int var3, boolean var4, boolean var5) {
      Object var6 = null;
      byte[] var7;
      if (!var4 && var5) {
         var7 = com.aspose.cells.b.a.zc.a((short)(var2 - var3));
      } else {
         var7 = com.aspose.cells.b.a.zc.a((short)var2);
      }

      var0[var1] = var7[0];
      var0[var1 + 1] = (byte)(var7[1] & 255 & 63 | var0[var1 + 1] & 255 & 192);
   }

   static void c(byte[] var0, int var1, int var2, int var3, boolean var4, boolean var5) {
      Object var6 = null;
      byte[] var7;
      if (!var4 && var5) {
         var7 = com.aspose.cells.b.a.zc.a((short)(var2 - var3));
      } else {
         var7 = com.aspose.cells.b.a.zc.a((short)var2);
      }

      var0[var1] = var7[0];
      var0[var1 + 1] = (byte)(var7[1] & 255 & 63 | var0[var1 + 1] & 255 & 192);
   }

   static int b(byte[] var0, int var1, int var2, byte var3) {
      if ((var3 & 255 & 64) == 0) {
         return com.aspose.cells.b.a.zc.e(var0, var1) & '\uffff' & 16383;
      } else {
         int var4 = com.aspose.cells.b.a.zc.e(var0, var1) & '\uffff' & 16383;
         if (var4 + var2 > 16383) {
            int var5 = var4 + var2 - 16383 - 1;
            return var5;
         } else {
            return var4 + var2;
         }
      }
   }
}
